<div id="main">
  <h2><%= t('h2.product_images') %></h2>
    <%= render :partial => "/admin/product_images/form", :locals => { :path => admin_product_product_images_path }%>
  <%#= render :partial => "search" %>
  <%= will_paginate @product_images %>
  <br class="clear"/>
  <table class="data2 order-table">
    <tr>
      <th><%= order_by_link :id,:text=>"ID"%></th>
      <th><%= ProductImage.human_attribute_name("image") %></th>
      <th width="15%"><%= order_by_link :created_at, :text => t("labels.created_at") %></th>
      <th width="12%"><%=  t('labels.operation') %></th>
    </tr>
    <% @product_images.each do |product_image| %>
      <tr class="<%= cycle("", "even") %>">
        <td><%= product_image.id %></td>
        <td>
          <% if  product_image.image_file_name.blank? %>
            无图片
          <% else %>
            <%= image_tag  product_image.image.url(:thumb) %>
          <% end %>
        </td>
        <td><%= parse_date product_image.created_at %></td>
        <td>
          <%= link_to t('labels.edit'), edit_admin_product_product_image_path(@product,product_image) %><br/>
          <%= link_to t('labels.delete'), admin_product_product_image_path(@product,product_image), :confirm => "are your sure?", :method => :delete %><br/>

        </td>
      </tr>
    <% end %>
  </table>

  <%= will_paginate @product_images %>

</div>
